package com.etc.service.impl;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.etc.dao.UsersMapper;
import com.etc.entity.Users;
import com.etc.service.UsersService;


/**
 * 
 * @ClassName: UsersServiceImpl 
 * @Description: @Transactional放在类前，这个类所有方法都用事务来管理
 * @author knowno  
 * @date 2022年4月1日 下午3:12:56 
 *
 */
@Transactional(propagation = Propagation.REQUIRED,isolation = Isolation.READ_COMMITTED)
@Service
public class UsersServiceImpl implements UsersService {
	
	@Autowired
	private UsersMapper mapper;

	/**
	 * 这个方法走事务管理	@Transactional
	 */
	@Transactional
	@Override
	public int addUser(Users user) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public Users getUsersById(int userid) {
		// TODO Auto-generated method stub
		return mapper.getUsersById(userid);
	}
}
